#ifndef __CLOCK_H
#define __CLOCK_H

#include "stm8s.h"

#define CLOCK_TIMEOUT   0x32
#define CLOCK_ADDR      0xd0 

typedef struct
{
  uint8_t data[8];
  uint16_t timer;
}type_clock;

void clock_init(void);
void clock_get(uint8_t *data);
void clock_set(uint8_t addr, uint8_t* data, uint8_t len);
void clock_modbus(uint8_t *pc);
void clock_timer(void);
#endif